home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Enciclopedia Del Perro
/
Enciclopedia Del Perro.iso
/
info31
/
simple2.sc_
/
simple2.sc
Wrap
Text File
|
1994-06-20
|
3KB
|
82 lines
<******************************************************* language=slang
Sample SLANG Modem Dialup Script
Description:
Simple Example #2 -- Written in the SLANG scripting language
This script dials the modem, enters a user-id after a short
delay, then a password after another short delay. Lastly,
packet mode is enabled so enable TCP/IP data transfers.
This script does not store a password directly, but prompts
the user for their password. This removes the security
problem of storing a password in plain-text in a file.
To Use This Script:
Change "0000" to the phone number of the remote machine you
would like to connect to.
Change "my-user_id" to your user id on the remote machine.
Adjust the intervals in the (pause,...) functions to suit
your needs. These are in milliseconds (5000 milliseconds ==
5 seconds).
This script assumes that your modem, and the remote host,
terminate commands with an ASCII Carrage-Return character.
If, instead, a Carrage-Return/Line-Feed (CRLF) is required,
change "(cr)" to "(cr)(lf)" everywhere in the script it is
necessary.
Notes:
This is a very simple dial script. It assumes that:
o the modem connection will always be made
o the remote machine will always be ready for your
user-id after a set interval
o like-wise for your password
This script is is optimistic and makes no provisions for
errors. More complex examples provided demonstrate error
handling, and many other options using features of SLANG.
Built-In SLANG Functions Used:
send Send a character string to the modem.
cr Return a Carriage-Return character.
pause Wait a specified number of milliseconds.
output Output a string to the screen.
input Input a string from the keyboard (hit ENTER
at end of string).
changemode Changes mode of connection from "raw" to
"packet".
************************************************************************>
(send, <* Dial the remote modem/host *>
{ATDT0000} <* Modem command and phone number *>
(cr) <* Carrage-Return after modem cmd *>
) <* End of "send" function *>
(pause, 30000) <* Wait for the modem to connect *>
(send, <* Log-in to the remote modem/host *>
{my-user-id} <* Send your user id *>
(cr) <* Carrage-Return after user id *>
) <* End of "send" function *>
(pause, 5000) <* Wait for a password prompt *>
(output,
{
Password Please? } <* Spaces in the { } are displayed *>
) <* End of "output" function *>
(send, <* Send the password *>
(input) <* Enter password from the keyboard*>
(cr) <* Carrage-Return after password *>
) <* End of "send" function *>
(pause, 3000) <* Pause for a moment *>
(changemode, packet) <* Change to "packet" mode *>